package cn.woblog.recyclerviewsample.divider;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by renpingqing on 2017/4/6.
 */

public class StaggeredGridDivider extends RecyclerView.ItemDecoration {

  public StaggeredGridDivider() {

  }

  @Override
  public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
      RecyclerView.State state) {
    outRect.left = 100;
    outRect.right = 100;
    outRect.bottom = 100;
    if (parent.getChildAdapterPosition(view) == 0) {
      outRect.top = 100;
    }
  }
}
